<!DOCTYPE html>
<html>
<head>

    <template file="Home/meta" />


    <template file="Home/css" />









</head>
<body style="padding-bottom: 101px">

<div class="swiper-container">
    <div class="swiper-wrapper">
<template file="Home/search" />

        <if condition="!I('get.j_id')">
            <template file="Home/slide" />
        </if>



<div class="am-g am-padding-vertical-sm common-border-bottom  common-border-top am-margin-top-sm  index_cate_product" id="wrapper">




    <div class="am-block">


        <ul class="am-avg-sm-2 am-text-xs"  id="product_list"></ul>




    </div>


</div>





<button class="am-btn am-btn-hui am-btn-block am-margin-bottom-sm" ID="add_news" onclick="add_news(this)">点击加载更多</button>






<div class="am-navbar am-cf am-navbar-index  common-border-top"  style="height: 101px;">

    <div class="product_order am-text-fff " >

        <ul class="am-avg-sm-4  am-text-center">
            <li   <if condition="I('get.order') eq 'zonghe'">  class="active"</if>> <a href="{:U('',array('order'=>'zonghe'))}">综合</a></li>

            <li <if condition="I('get.order') eq 'new'">  class="active"</if>> <a href="{:U('',array('order'=>'new'))}">新品</a></li>

            <if condition="I('get.order') eq 'price'">

                <if condition="I('get.sort') eq 'asc'">

                    <li  class="active"> <a href="{:U('',array('order'=>'price','sort'=>'desc'))}">价格 <i class="am-icon-sort-amount-asc"></i></a></li>
                    <else/>
                    <li  class="active"> <a href="{:U('',array('order'=>'price','sort'=>'asc'))}">价格<i class="am-icon-sort-amount-desc"></i></a></li>

                </if >


                <else/>

                <li> <a href="{:U('',array('order'=>'price','sort'=>'asc'))}">价格 <i class="am-icon-sort"></i></a></li>


            </if>



            <li><a href="/Product/cate"> <span class="bujinhua">&#xe643;</span></a> </li>
        </ul>




    </div>
    <template file="Home/bottom_nav" />
    <div class="preloader"> Loading... </div>
    </div>
        </div>
</div>
<template file="Home/js" />


<script src="/Statics/Home/js/swiper/swiper.min.js"></script>



<script>




    num = 1;

    function add_news(obj) {

        $.post("{:get_now_url()}", { page: num }, function (data) {
            var html = $("#product_list").html();

            if (data!=null) {


                $.each(data, function (news, v) {




                    html += " <li class='am-padding-xs'>";

                    html += "                <div  class=' am-padding-xs am-padding-vertical-sm am-block' >";

                    html += "                    <div class='img'>";
                    html += "                        <a href='/Home/Product/show/id/"+ v.id+"'>";
                    html += "                            <img class='am-img-responsive' src='"+ v.thumb+"' alt=''>";
                    html += "                        </a>";

                    html += "                    </div>";
                    html += "                    <a href='/Home/Product/show/id/"+ v.id+"' class='title am-block am-text-center am-text-truncate'>作品名《"+ v.title+"》</a>";
                    html += " <div class='am-cf'><div class='am-u-sm-6 am-text-xs chicun am-padding-horizontal-0'>"+v.chicun+" </div> <div class='am-text-xs am-u-sm-6 price'>￥ "+v.price+"</div>              ";

                    html += "                </div>";
                    html += "            </li>";




                });

                $("#product_list").html(html);

                num++;
            }
            else {

                $(obj).attr("disabled", "disabled");
                $(obj).html("没有了");
            }

        });


    }
    $(function () {
        add_news();





    })





</script>



</body>
</html>